<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      zsh-5.8
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-9.1">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 9.1
      </h4>
      <h3>
        Chapter&nbsp;7.&nbsp;Shells
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="tcsh.html" title="Tcsh-6.22.02">Prev</a>
          <p>
            Tcsh-6.22.02
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="virtualization.html" title=
          "Virtualization">Next</a>
          <p>
            Virtualization
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="shells.html" title=
          "Chapter&nbsp;7.&nbsp;Shells">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="zsh" name="zsh"></a>zsh-5.8
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to zsh
        </h2>
        <p>
          The <span class="application">zsh</span> package contains a command
          interpreter (shell) usable as an interactive login shell and as a
          shell script command processor. Of the standard shells,
          <span class="application">zsh</span> most closely resembles
          <span class="application">ksh</span> but includes many
          enhancements.
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "http://www.zsh.org/pub/zsh-5.8.tar.xz">http://www.zsh.org/pub/zsh-5.8.tar.xz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: e02a5428620b3dd268800c7843b3dd4d
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 3.0 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 72 MB (includes documentation
                and tests)
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 1.3 SBU (Using parallelism=4; includes
                documentation and tests)
              </p>
            </li>
          </ul>
        </div>
        <h3>
          Additional Downloads
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Optional Documentation: <a class="ulink" href=
                "http://www.zsh.org/pub/zsh-5.8-doc.tar.xz">http://www.zsh.org/pub/zsh-5.8-doc.tar.xz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Documentation MD5 sum: ef8514401a81bb1a4c4b655ebda8a1a2
              </p>
            </li>
            <li class="listitem">
              <p>
                Documentation download size: 3.0 MB
              </p>
            </li>
          </ul>
        </div>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            When there is a new <span class="application">zsh</span> release,
            the old files shown above are moved to a new server directory:
            <a class="ulink" href=
            "http://www.zsh.org/pub/old/">http://www.zsh.org/pub/old/</a>.
          </p>
        </div>
        <h3>
          zsh Dependencies
        </h3>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="libcap.html" title=
          "libcap-2.31 with PAM">libcap-2.31 with PAM</a>, <a class="xref"
          href="../general/pcre.html" title="PCRE-8.44">PCRE-8.44</a>, and
          <a class="xref" href="../general/valgrind.html" title=
          "Valgrind-3.15.0">Valgrind-3.15.0</a>,
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/zsh">http://wiki.linuxfromscratch.org/blfs/wiki/zsh</a>
        </p>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of zsh
        </h2>
        <p>
          If you downloaded the optional documentation, unpack it with the
          following command:
        </p>
        <pre class="userinput">
<kbd class=
"command">tar --strip-components=1 -xvf ../zsh-5.8-doc.tar.xz</kbd>
</pre>
        <p>
          Install <span class="application">zsh</span> by running the
          following commands:
        </p>
        <pre class="userinput">
<kbd class="command">./configure --prefix=/usr         \
            --bindir=/bin         \
            --sysconfdir=/etc/zsh \
            --enable-etcdir=/etc/zsh                  &amp;&amp;
make                                                  &amp;&amp;

makeinfo  Doc/zsh.texi --plaintext -o Doc/zsh.txt     &amp;&amp;
makeinfo  Doc/zsh.texi --html      -o Doc/html        &amp;&amp;
makeinfo  Doc/zsh.texi --html --no-split --no-headers -o Doc/zsh.html</kbd>
</pre>
        <p>
          If you have <a class="xref" href="../pst/texlive.html" title=
          "texlive-20190410-source">texlive-20190410</a> installed, you can
          build PDF format of the documentation by issuing the following
          command:
        </p>
        <pre class="userinput">
<kbd class="command">texi2pdf  Doc/zsh.texi -o Doc/zsh.pdf</kbd>
</pre>
        <p>
          To test the results, issue: <span class="command"><strong>make
          check</strong></span>.
        </p>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">make install                              &amp;&amp;
make infodir=/usr/share/info install.info &amp;&amp;

install -v -m755 -d                 /usr/share/doc/zsh-5.8/html &amp;&amp;
install -v -m644 Doc/html/*         /usr/share/doc/zsh-5.8/html &amp;&amp;
install -v -m644 Doc/zsh.{html,txt} /usr/share/doc/zsh-5.8</kbd>
</pre>
        <p>
          If you downloaded the optional documentation, install it by issuing
          the following commands as the <code class="systemitem">root</code>
          user:
        </p>
        <pre class="root">
<kbd class=
"command">make htmldir=/usr/share/doc/zsh-5.8/html install.html &amp;&amp;
install -v -m644 Doc/zsh.dvi /usr/share/doc/zsh-5.8</kbd>
</pre>
        <p>
          If you built the PDF format of the documentation, install it by
          issuing the following command as the <code class=
          "systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class=
"command">install -v -m644 Doc/zsh.pdf /usr/share/doc/zsh-5.8</kbd>
</pre>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <em class="parameter"><code>--sysconfdir=/etc/zsh</code></em> and
          <em class="parameter"><code>--enable-etcdir=/etc/zsh</code></em>:
          These parameters are used so that all the <span class=
          "application">zsh</span> configuration files are consolidated into
          the <code class="filename">/etc/zsh</code> directory. Omit these
          parameters if you wish to retain historical compatibility by having
          all the files located in the <code class="filename">/etc</code>
          directory.
        </p>
        <p>
          <em class="parameter"><code>--bindir=/bin</code></em>: This
          parameter places the <span class=
          "command"><strong>zsh</strong></span> binaries into the root
          filesystem.
        </p>
        <p>
          <code class="option">--enable-cap</code>: This option enables POSIX
          capabilities.
        </p>
        <p>
          <code class="option">--disable-gdbm</code>: This option disables
          the use of the <span class="application">GDBM</span> library.
        </p>
        <p>
          <code class="option">--enable-pcre</code>: This option allows zsh
          to use the <span class="application">PCRE</span> regular expression
          library in shell builtins.
        </p>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="mountpoints" name="mountpoints"></a>
          </h3>
          <h4 class="title">
            <a id="mountpoints" name="mountpoints"></a>Multiple partitions
          </h4>
          <p>
            Linking <span class="application">zsh</span> dynamically against
            <span class="application">pcre</span> and/or <span class=
            "application">gdbm</span> produces runtime dependencies on
            <code class="filename">libpcre.so</code> and/or <code class=
            "filename">libgdbm.so</code> respectively, which both reside in
            <code class="filename">/usr</code> hierarchy. If <code class=
            "filename">/usr</code> is a separate mount point and <span class=
            "application">zsh</span> needs to be available in boot time, then
            its supporting libraries should be in <code class=
            "filename">/lib</code> too. You can move the libraries as
            follows:
          </p>
          <pre class="root">
<kbd class="command">mv -v /usr/lib/libpcre.so.* /lib &amp;&amp;
ln -v -sf ../../lib/libpcre.so.0 /usr/lib/libpcre.so

mv -v /usr/lib/libgdbm.so.* /lib &amp;&amp;
ln -v -sf ../../lib/libgdbm.so.3 /usr/lib/libgdbm.so</kbd>
</pre>
          <p>
            Alternatively you can statically link <span class=
            "application">zsh</span> against <span class=
            "application">pcre</span> and <span class=
            "application">gdbm</span> if you modify the <code class=
            "filename">config.modules</code> file (you need first to run
            configure to generate it).
          </p>
        </div>
      </div>
      <div class="configuration" lang="en" xml:lang="en">
        <h2 class="sect2">
          Configuring zsh
        </h2>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="zsh-config" name="zsh-config"></a>
          </h3>
          <h4 class="title">
            <a id="zsh-config" name="zsh-config"></a>Config Files
          </h4>
          <p>
            There are a whole host of configuration files for <span class=
            "application">zsh</span> including <code class=
            "filename">/etc/zsh/zshenv</code>, <code class=
            "filename">/etc/zsh/zprofile</code>, <code class=
            "filename">/etc/zsh/zshrc</code>, <code class=
            "filename">/etc/zsh/zlogin</code> and <code class=
            "filename">/etc/zsh/zlogout</code>. You can find more information
            on these in the <code class="filename">zsh(1)</code> and related
            manual pages.
          </p>
          <p>
            The first time zsh is executed, you will be prompted by messages
            asking several questions. The answers will be used to create a
            <code class="filename">~/.zshrc</code> file. If you wish to run
            these questions again, run <span class="command"><strong>zsh
            /usr/share/zsh/5.8/functions/zsh-newuser-install
            -f</strong></span>.
          </p>
          <p>
            There are several built-in advanced prompts. In the <span class=
            "command"><strong>zsh</strong></span> shell, start advanced
            prompt support with <span class="command"><strong>autoload -U
            promptinit</strong></span>, then <span class=
            "command"><strong>promptinit</strong></span>. Available prompt
            names are listed with <span class="command"><strong>prompt
            -l</strong></span>. Select a particular one with <span class=
            "command"><strong>prompt <code class=
            "literal">&lt;prompt-name&gt;</code></strong></span>. Display all
            available prompts with <span class="command"><strong>prompt
            -p</strong></span>. Except for the list and display commands
            above, you can insert the other ones in <code class=
            "filename">~/.zshrc</code> to be automatically executed at shell
            start, with the prompt you chose.
          </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3"></h3>
          <h4 class="title">
            <a id="idm45779281121072" name=
            "idm45779281121072"></a>Configuration Information
          </h4>
          <p>
            Update <code class="filename">/etc/shells</code> to include the
            <span class="application">zsh</span> shell program names (as the
            <code class="systemitem">root</code> user):
          </p>
          <pre class="root">
<kbd class="command">cat &gt;&gt; /etc/shells &lt;&lt; "EOF"
<code class="literal">/bin/zsh</code>
EOF</kbd>
</pre>
        </div>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">zsh and zsh-5.8 (hardlinked to each
              other)</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">Numerous plugin helper modules under
              /usr/lib/zsh/5.8/</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">/usr/{lib,share}/zsh and
              /usr/share/doc/zsh-5.8</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Description
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="zsh-prog" name="zsh-prog"></a><span class=
                    "term"><span class=
                    "command"><strong>zsh</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a shell which has command-line editing, built-in
                    spelling correction, programmable command completion,
                    shell functions (with autoloading), a history mechanism,
                    and a host of other features.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-02-17 18:27:03 -0800
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="tcsh.html" title="Tcsh-6.22.02">Prev</a>
          <p>
            Tcsh-6.22.02
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="virtualization.html" title=
          "Virtualization">Next</a>
          <p>
            Virtualization
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="shells.html" title=
          "Chapter&nbsp;7.&nbsp;Shells">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
